package com.ymttest.database.mapping;

import com.ymttest.database.model.ProductImportDetail;
import com.ymttest.database.model.ProductImportTask;
import com.ymttest.database.model.ProductPacket;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface ProductImporterMapper {

    @Select("select * from ProductImportTask where TaskId = #{taskId}")
    List<ProductImportTask> selectProductImportTaskByTaskId(int taskId);

    @Select("select * from ProductPacket where TaskId = #{taskId}")
    List<ProductPacket> selectProductPacketByTaskId(int taskId);

    @Select("select * from ProductImportDetail where TaskId = #{taskId}")
    List<ProductImportDetail> selectProductImportDetailByTaskId(int taskId);

    @Select("select count(*) from ProductImportTask where SellerId = #{sellerId}")
    List<Integer> selectTotalNumBySellerId(int sellerId);

    @Select("select * from productimportdetail where TaskId = #{taskId} and IsSuccess = #{success}")
    List<ProductImportDetail> selectProductImportDetailByTaskIdWithIsSuccess(Map m);

}
